package app.web.qk.controller;

import app.config.Config;
import com.gitee.feizns.quickstart.spring.expression.SpEl;
import com.gitee.feizns.quickstart.web.WebUtils;
import com.gitee.feizns.quickstart.web.spring.boot.autoconfigure.UploadController;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;
import java.util.Objects;

/**
 * 通用模块/文件上传
 * @author feizns
 * @since 2025/4/10
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("/api/v1/qk")
public class QkUploadController extends UploadController {

    @Override
    public String baseUrl() {
        Object baseUrl = SpEl.execute(
                Config.qkUploadBaseUrl(),
                Map.of("ServerName", WebUtils.getServerName())
        );
        return Objects.toString(baseUrl);
    }

}
